</head>
<body>
<div class="f-sep10"></div>
<div class="f-sep10"></div>
<div class="m-hd m-tabs">
  <h2 class="u-tt">{$action_name}会员</h2>
  <ul id="tabs">
    <li> <a class="z-crt" href="#tab1">基本信息</a></li>
    <li> <a href="#tab2">用户资料</a></li>
	<!--foreach:{$tab_list $vo}-->
	<li><a href="#{$vo.mark}">{$vo.name}</a></li>
	<!--{/foreach}-->
	<li> <a href="{$url(user_list/index)}">用户列表</a></li>
  </ul>
</div>
<div class="f-sep10"></div>
<div class="m-form">
  <form action="<?php echo url('user_list/'.$action.'_save'); ?>" method="post" id="form">
    <fieldset>
    <div id="tab1">
      <div class="formitm">
        <label class="lab" >会员组：</label>
        <div class="ipt">
          <select name="gid" id="gid">
            <!--foreach:{$user_group $vo}-->
            <option value="{$vo.gid}">{$vo.name}</option>
            <!--{/foreach}-->
          </select>
          <span class="Validform_checktip"></span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >帐号：</label>
        <div class="ipt">
          <input name="username" type="text" class="u-ipt" value="{$info.username}" datatype="s1-20" errormsg="帐号至少1~20个字符！" />
          <span class="Validform_checktip"></span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >昵称：</label>
        <div class="ipt">
          <input name="nicename" type="text" class="u-ipt" value="{$info.nicename}" datatype="s1-20" errormsg="昵称至少1~20个字符！" />
          <span class="Validform_checktip"></span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >密码：</label>
        <div class="ipt">
          <input name="password" type="password" class="u-ipt" />
          <span class="Validform_checktip"></span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >确认密码：</label>
        <div class="ipt">
          <input name="password2" type="password" class="u-ipt"  />
          <span class="Validform_checktip"></span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >状态：</label>
        <div class="ipt">
          <?php if(!isset($info['status'])){ $info['status']=1; } ?>
          <input name="status" type="radio" value="1" <!--if:{$info['status']==1}--> checked="checked" <!--{/if}--> />
          正常&nbsp;&nbsp; <input name="status" type="radio" value="0" <!--if:{$info['status']==0}--> checked="checked" <!--{/if}--> />
          禁用 <span class="Validform_checktip"></span> </div>
      </div>
      </div>
      <div id="tab2">
      
      <div class="formitm">
        <label class="lab" >邮箱：</label>
        <div class="ipt">
          <input name="email" type="text" class="u-ipt" id="email" value="{$info.email}"  />
          <span class="Validform_checktip"></span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >头像：</label>
        <div class="ipt">
          <input name="avatar" type="text" class="u-ipt" value="{$info.avatar}" />
          <span class="Validform_checktip"></span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >手机：</label>
        <div class="ipt">
          <input name="tel" type="text" class="u-ipt" id="tel" value="{$info.tel}" />
          <span class="Validform_checktip"></span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >qq：</label>
        <div class="ipt">
          <input name="qq" type="text" class="u-ipt" id="qq" value="{$info.qq}" />
          <span class="Validform_checktip"></span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >座机：</label>
        <div class="ipt">
          <input name="landline" type="text" class="u-ipt" id="landline" value="{$info.landline}" />
          <span class="Validform_checktip"></span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >公司名称：</label>
        <div class="ipt">
          <input name="company" type="text" class="u-ipt" id="company" value="{$info.company}" />
          <span class="Validform_checktip"></span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >详细地址：</label>
        <div class="ipt">
          <input name="address" type="text" class="u-ipt" id="address" value="{$info.address}" />
          <span class="Validform_checktip"></span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >所在地：</label>
        <div class="ipt">
          <select name="province" id="province"  onchange="loadregion();" >
            <option value="0">省份/直辖市</option>
            <!--foreach:{$province_list $vo}-->
            <option value="{$vo.id}" <?php if($vo['id']==$info['province']){ ?> selected="selected" <?php } ?> >{$vo.name}</option>
            <!--{/foreach}-->
          </select>
          &nbsp;&nbsp;<select name="city" id="city">
       		<option value="0">市/县</option>
             <!--foreach:{$city_list $vo}-->
            <option value="{$vo.id}" <?php if($vo['id']==$info['city']){ ?> selected="selected" <?php } ?> >{$vo.name}</option>
            <!--{/foreach}-->
     		</select>
      </div>
	  
	  <!--foreach:{$tab_html $vo}-->
		 <div id="{$vo.mark}">
			{$vo.html}
		 </div>
		 <!--{/foreach}-->
		 
      </div>
      <div class="formitm formitm-1">
        <button class="u-btn" id="submit" type="submit">保存修改</button>
        <button class="u-btn u-btn-c4" id="reset" type="button">重置</button>
        <span id="tip" class="load"></span> </div>
    </fieldset>
    <input name="uid" type="hidden" value="{$info.uid}" />
  </form>
</div>
</body>
<script>
var loadregion = new function(){}; 
Do.ready('base','form','tabs', function() {
	//地区联动
	window.loadregion=function loadregion(){
		$("#city option").each(function(){
			$(this).remove();
		});
		$("<option value=0>请选择</option>").appendTo($("#city"));
		if($("#province").val()==0){
			return;
		}
		$.post('{$url(user_list/get_province)}',{pid:$("#province").val(),type:2},
			function(json){
				if(json.status=='y'){
					$.each(json.info,function(idx,item){
						$("<option value="+item.id+">"+item.name+"</option>").appendTo($("#city"));
					});
				}else{
					$("<option value='0'>请选择</option>").appendTo($("#city"));
				}
			},'json'
		);
	}
	saveform('{$url(user_list/index)}');
	tabs();
});
</script>